/**
 * 
 */
package br.com.estrategos.modelo.conta;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.ForeignKey;

/**
 * @author x12259401
 *
 */
@MappedSuperclass
public abstract class Prestacao {

	@Id
	@GeneratedValue
	@Column(name = "idprestacao", unique = true, length = 10)
	private Long idPrestacao;
	
	
	private Date dtvencimento;
	
	@Column(nullable=false, scale=10, precision=2, columnDefinition="decimal(10,2)")
	private BigDecimal valor;
	
	@Column(name = "status", columnDefinition = "char(1)")
	private String status;
	
	@ManyToOne(targetEntity = ContaEntity.class, fetch = FetchType.LAZY)
	@ForeignKey(name = "fk_idconta")
	@JoinColumn(name = "idconta", nullable = false)
	private ContaEntity conta;

	public Long getIdPrestacao() {
		return idPrestacao;
	}

	public void setIdPrestacao(Long idPrestacao) {
		this.idPrestacao = idPrestacao;
	}

	public Date getDtvencimento() {
		return dtvencimento;
	}

	public void setDtvencimento(Date dtvencimento) {
		this.dtvencimento = dtvencimento;
	}



	public BigDecimal getValor() {
		return valor;
	}

	public void setValor(BigDecimal valor) {
		this.valor = valor;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public ContaEntity getConta() {
		return conta;
	}

	public void setConta(ContaEntity conta) {
		this.conta = conta;
	}
	
	
}
